<?php
if( ! defined('BASEPATH')) exit('No direct script access allowed');

class founder_attendance extends CI_Controller
{


	function __construct()
	{
		parent::__construct();

		// check if user logged in
		if(!$this->ion_auth->logged_in() && !$this->ion_auth->is_admin()){
			redirect('auth/login');
		}
		$this->load->library('form_validation');
		$this->load->model('hrm/founder/attendance_model');
	}

	function index($id,$year_id,$month_id)
	{
		$meta['page_title'] = 'Attendance';
		$data['daily_sheets']= $this->attendance_model->get_details($id,$year_id,$month_id);
		$data['user_id'] = $id;
		$data['attendance'] = $this->attendance_model->get_attendance_details($id);
		$yid = '20'.$year_id;
		$data['num'] = cal_days_in_month(CAL_GREGORIAN, $month_id, $yid);
		
		$data['min_working_hr'] = $this->attendance_model->get_working_hr($id);
		$meta['dashboard'] = 'dashboard';
		$this->load->view('common/header', $meta);
		$this->load->view('hrm/founder/attendance',$data);
		$this->load->view('common/footer');
	}


}

?>